﻿<%@ Page Title="" Language="C#" MasterPageFile="~/administrator/backend.Master" AutoEventWireup="true" CodeBehind="user-add.aspx.cs" Inherits="VQWEB.administrator.membership.user_add" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Content_backend" runat="server">
    <form id="frm_users" runat="server" role="form">
    <asp:FormView runat="server" ID="frmUsers" RenderOuterTable="false" OnItemCreated="frmUsers_ItemCreated">
        <EditItemTemplate>
            <div class="form-group">
                <label>
                    Roles Name</label>
                <asp:Literal ID="ltrRoleId" runat="server" />
            </div>
            <div class="form-group">
                <label>
                    User Name</label>
                <input class="form-control" name="user_name" type="text" value='<%# Eval("user_name") %>'>
            </div>
            <div class="form-group">
                <label>
                    User Email</label>
                <input class="form-control" name="user_email" value='<%# Eval("user_email") %>' type="text">
            </div>
            <div class="form-group">
                <label>
                    User Pass</label>
                <input class="form-control" name="user_password" value='<%# Eval("user_password") %>'
                    type="text">
            </div>
            <div class="checkbox">
                <label>
                    <input name="user_active" type="checkbox" <%# Eval("user_active") !=null && (bool)(Eval("user_active")) ? " checked='checked'" : null %>
                        value="True">
                    Active
                </label>
                &nbsp;</div>
            <input name="user_id" type="hidden" value='<%# (Eval("user_id") != null) ? Eval("user_id") : "0" %>' />
        </EditItemTemplate>
    </asp:FormView>
    </form>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Script_backend" runat="server">
    <script type="text/javascript">
        ShowToolBar("edit");
        var url_ashx = "/admin/membership/handler";
        $("#btnCancel").live("click", function () {
            window.location = "/admin/membership/user/list";
        });
        $("#btnSave").live("click", function () {
            var arr = $("#frm_users").serializeObject();
            $.post(url_ashx, { post_users: arr }, function (data) {
                alert(data);
                window.location = "/admin/membership/user/list";
            });
        });
    </script>
</asp:Content>
